<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function fun(val){
            alert(val);
        }
    </script>
</head>
<body>
<div th:text="${abc}"></div>
<img th:src="@{/git.png}" style="width: 130px;height: 130px" />
<div>
    <a th:href="@{/thymeleaf/show(id=111)}" >跳转</a>
</div>
<div th:text="'abcde'"></div>
<div th:attr="style='border:1px solid red;width:150px;'" th:text="'abc 123'"></div>
<div th:text="'abc'+'123'"></div>
<div th:text="1<2"></div>
<div th:text="|ab c${abc}12 3|"></div>
<div th:text="|control传递的参数：${abc}QQQ|"></div>
<div th:if="1<2" th:style="1<2?'border:1px solid red;':''">1<2</div>

<div th:unless="${str1}==null">str1不是null</div>
<div th:if="${str1}==''">str1是''</div>
<div th:if="${str1} eq ''">str1是''</div>
<hr>
<div th:if="${str2==null}">str2是null</div>
<div th:if="${str2 eq null}">str2是null</div>
<div th:unless="${str2==''}">str2不是''</div>

<div>[[${str2}==null?'str2是null':'str2不是null']]</div>
<div>[[${str2==null}?'str2是null':'str2不是null']]</div>
<div>[[${str2==null?'str2是null':"str2不是null"}]]</div>
<form action="./abc" th:attr="action=${action}">
    <input type="text" name="username" th:attr="value=${buttonName}+'abc',id='username'"/>
    <input type="button" value="登陆" th:attr="value=${buttonName},onclick='fun(123)'" />
    <input type="button" value="登陆" th:attr="value=${buttonName},onclick='fun(\''+${buttonName}+'\')'" />
</form>

insert插入，replace是替换
<div th:replace="comment/include::head"></div>
<div th:insert="comment/include::footer('V3')"></div>
<div th:insert="~{comment/include::footer('V3')}"></div>
<div th:replace="comment/include::footer('V3')"></div>
<!--当前目录下的模板-->
<div th:fragment="footer1(version)">
    &copy; 当前文件下的函数型模板&nbsp;&nbsp;[[${version}]]
</div>
<div th:replace="::footer1('V4')"></div>
</body>
</html>